﻿@using UsedBookTradeSystem.Models.Entity
@using UsedBookTradeSystem.Models.Dtos.OutputDtos
@using UsedBookTradeSystem.Models.Enum;
@{
    ViewData["Title"] = "Show";
    Layout = "~/Views/Shared/_Layout.cshtml";
    Order order = ViewBag.Order;
    List<CartInfoOutput> Orderdetail = ViewBag.Orderdetail;

    int index = 0;
}
<section class="py-5 bg-light">
    <div class="container">
        <div class="row px-4 px-lg-5 py-lg-4 align-items-center">
            <div class="col-lg-6">
                <h1 class="h2 text-uppercase mb-0">订单详情</h1>
            </div>
            <div class="col-lg-6 text-lg-end">
                <nav aria-label="breadcrumb">
                    <ol class="breadcrumb justify-content-lg-end mb-0 px-0 bg-light">
                        <li class="breadcrumb-item"><a class="text-dark" href="/Home/Shop">商城</a></li>
                        <li class="breadcrumb-item"><a class="text-dark" href="/Shopper/Index">个人中心</a></li>
                        <li class="breadcrumb-item active" aria-current="page">订单详情</li>
                    </ol>
                </nav>
            </div>
        </div>
    </div>
</section>
<section class="py-5">
    <!-- BILLING ADDRESS-->
    <h2 class="h5 text-uppercase mb-4">基本信息</h2>
    <div class="row">
        <div class="col-lg-12">
            <div class="row gy-3">
                <div class="col-lg-12">
                    <label class="form-label text-sm text-uppercase" for="firstName">收件人 </label>
                    <input class="form-control form-control-lg" type="text" id="firstName" name="UserName" value="@order.UserName" placeholder="请输入收件人" readonly>
                </div>
                <div class="col-lg-12">
                    <label class="form-label text-sm text-uppercase" for="firstName">电话 </label>
                    <input class="form-control form-control-lg" type="text" id="firstName" name="UserName" value="@order.Tel" placeholder="请输入电话" readonly>
                </div>
                <div class="col-lg-12">
                    <label class="form-label text-sm text-uppercase" for="firstName">收件地址 </label>
                    <input class="form-control form-control-lg" type="text" id="firstName" name="UserName" value="@order.Address" placeholder="收件地址" readonly>
                </div>

            </div>
        </div>
    </div>
</section>
<section class="py-5">
    <div class="card">
        <div class="card-header">
            <p style="display:inline;vertical-align:middle">货物列表</p>
        </div>
        <table class="table card-table">
            <thead class="thead-light">
                <tr>
                    <th>#</th>
                    <th>书名</th>
                    <th>价格</th>
                    <th>数量</th>
                    <th>总价</th>
                </tr>
            </thead>
            <tbody>
                @foreach (CartInfoOutput item in Orderdetail)
                {
                    index++;
                    <tr>
                        <td scope="row" style="vertical-align:middle">@index</td>
                        <td style="vertical-align:middle">@item.BookName</td>
                        <td style="vertical-align:middle">@item.Price</td>
                        <td style="vertical-align:middle">@item.BookCount</td>
                        <td style="vertical-align:middle">￥@item.TotolPrice</td>
                    </tr>
                }
                @if (index == 0)
                {
                    <tr>
                        <td colspan="4" style="vertical-align:central;text-align:center;"> 暂无数据 </td>
                    </tr>

                }
            </tbody>
        </table>

    </div>
</section>

